package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.discount_info;
import com.ymttest.database.model.discount_qualification;
import com.ymttest.utils.EnvSetup;

public class discount_qualificationWapper {
	SqlManager manager;

    public discount_qualificationWapper() {
        manager = new SqlManager("mysqlplatformdiscounts" + EnvSetup.getEnv());
    }

    public discount_qualification selectTop1(String sourceId,String userId,String productId) {
    	Map<String,Object> map=new HashMap();
    	map.put("sourceId", sourceId);
    	map.put("userId", userId);
    	map.put("productId", productId);
    	discount_qualification model=new discount_qualification();
        List<discount_qualification> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.discount_qualificationMapper.selectTop1",
                        map);
        if(result.size()>0)
        	model=result.get(0);
        manager.commit();
        return model;
    }

    
    public int updateByPrimaryKey(discount_qualification record) {
        int result = manager.update(
                        "com.ymttest.database.mapping.discount_qualificationMapper.updateByPrimaryKey",
                        record);
        manager.commit();
        return result;
    }
 
    public static void main(String[] args) {
    	discount_qualificationWapper test = new discount_qualificationWapper();

    	test.selectTop1("100","44146","1b2d8266-d9fd-4f0f-80eb-01d5823b6a1c");
    System.out.print("ok");

    }
}
